<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Example::ExampleMatcher</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Example::ExampleMatcher</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/example/example_matcher_rb.html">
                vendor/plugins/rspec/lib/spec/example/example_matcher.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000364">example_group_regex</a>&nbsp;&nbsp;
      <a href="#M000366">example_group_regex_not_considering_modules</a>&nbsp;&nbsp;
      <a href="#M000365">example_group_with_before_all_regexp</a>&nbsp;&nbsp;
      <a href="#M000367">example_regexp</a>&nbsp;&nbsp;
      <a href="#M000361">matches?</a>&nbsp;&nbsp;
      <a href="#M000363">matches_example_not_considering_modules?</a>&nbsp;&nbsp;
      <a href="#M000362">matches_literal_example?</a>&nbsp;&nbsp;
      <a href="#M000360">new</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000360" class="method-detail">
        <a name="M000360"></a>

        <div class="method-heading">
          <a href="#M000360" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(example_group_description, example_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000360-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000360-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 4</span>
4:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">example_group_description</span>, <span class="ruby-identifier">example_name</span>)
5:         <span class="ruby-ivar">@example_group_description</span> = <span class="ruby-identifier">example_group_description</span>
6:         <span class="ruby-ivar">@example_name</span> = <span class="ruby-identifier">example_name</span>
7:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000361" class="method-detail">
        <a name="M000361"></a>

        <div class="method-heading">
          <a href="#M000361" class="method-signature">
          <span class="method-name">matches?</span><span class="method-args">(specified_examples)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000361-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000361-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 9</span>
 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">specified_examples</span>)
10:         <span class="ruby-identifier">specified_examples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">specified_example</span><span class="ruby-operator">|</span>
11:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matches_literal_example?</span>(<span class="ruby-identifier">specified_example</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">matches_example_not_considering_modules?</span>(<span class="ruby-identifier">specified_example</span>)
12:         <span class="ruby-keyword kw">end</span>
13:         <span class="ruby-keyword kw">false</span>
14:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000364" class="method-detail">
        <a name="M000364"></a>

        <div class="method-heading">
          <a href="#M000364" class="method-signature">
          <span class="method-name">example_group_regex</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000364-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000364-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 25</span>
25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_group_regex</span>
26:         <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-ivar">@example_group_description</span>)
27:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000366" class="method-detail">
        <a name="M000366"></a>

        <div class="method-heading">
          <a href="#M000366" class="method-signature">
          <span class="method-name">example_group_regex_not_considering_modules</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000366-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000366-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 33</span>
33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_group_regex_not_considering_modules</span>
34:         <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-ivar">@example_group_description</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'::'</span>).<span class="ruby-identifier">last</span>)
35:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000365" class="method-detail">
        <a name="M000365"></a>

        <div class="method-heading">
          <a href="#M000365" class="method-signature">
          <span class="method-name">example_group_with_before_all_regexp</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000365-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000365-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 29</span>
29:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_group_with_before_all_regexp</span>
30:         <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-node">&quot;#{@example_group_description} before(:all)&quot;</span>)
31:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000367" class="method-detail">
        <a name="M000367"></a>

        <div class="method-heading">
          <a href="#M000367" class="method-signature">
          <span class="method-name">example_regexp</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000367-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000367-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 37</span>
37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_regexp</span>
38:         <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-ivar">@example_name</span>)
39:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000363" class="method-detail">
        <a name="M000363"></a>

        <div class="method-heading">
          <a href="#M000363" class="method-signature">
          <span class="method-name">matches_example_not_considering_modules?</span><span class="method-args">(specified_example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000363-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000363-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 21</span>
21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_example_not_considering_modules?</span>(<span class="ruby-identifier">specified_example</span>)
22:         <span class="ruby-identifier">specified_example</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/(^#{example_group_regex_not_considering_modules} #{example_regexp}$|^#{example_group_regex_not_considering_modules}$|^#{example_regexp}$)/</span>
23:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000362" class="method-detail">
        <a name="M000362"></a>

        <div class="method-heading">
          <a href="#M000362" class="method-signature">
          <span class="method-name">matches_literal_example?</span><span class="method-args">(specified_example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000362-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000362-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_matcher.rb, line 17</span>
17:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_literal_example?</span>(<span class="ruby-identifier">specified_example</span>)
18:         <span class="ruby-identifier">specified_example</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/(^#{example_group_regex} #{example_regexp}$|^#{example_group_regex}$|^#{example_group_with_before_all_regexp}$|^#{example_regexp}$)/</span>
19:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>